//Author: xiaruize
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define pii pair<int, int>
#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define per(i, b, a) for (int i = (b); i >= (a); i--)
int testcase = 1, caseid;
const int N = 1e5 + 10;

int n;
int a[N];

void solve()
{
    cin >> n;
    rep(i, 1, n) cin >> a[i];
    sort(a + 1, a + n + 1);
    int cur = 1;
    rep(i, 2, n)
    {
        if (a[i] > a[cur])
            cur++;
    }
    cout << n - cur + 1 << endl;
}

signed main()
{
    freopen("duel.in", "r", stdin);
    freopen("duel.out", "w", stdout);
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    // cin >> testcase;
    while (testcase--)
        solve();
    return 0;
}
//g++ duel.cpp -o duel -std=c++14 -Wall -fsanitize=address,undefined -O2